using System;
public static class IntExtensions
{
	public static void Times(this int value, Action action)
	{
		for (int i = 0; i < value; i++)
		{
			action();
		}
	}
	public static void Times(this int value, Action<int> action)
	{
		for (int i = 0; i < value; i++)
		{
			action(i);
		}
	}
	public static bool IsEven(this int value)
	{
		return value % 2 == 0;
	}
	public static bool IsOdd(this int value)
	{
		return !value.IsEven();
	}
	public static bool InRange(this int value, int minValue, int maxValue)
	{
		return value >= minValue && value <= maxValue;
	}
	public static int InRange(this int value, int minValue, int maxValue, int defaultValue)
	{
		if (!value.InRange(minValue, maxValue))
		{
			return defaultValue;
		}
		return value;
	}
}
